<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--<html xmlns="http//www.w3.org/1999/xhtml">-->
<head>   <!--登录入口-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon.png" />
<link rel="apple-touch-startup-image" href="images/apple-touch-startup-image.png" />
<meta name="author" content="FamousThemes" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>会员登录</title>


<link rel="stylesheet" href="css/login.css" type="text/css" media="screen" />

<link href='../fonts.googleapis.com/css@family=Niconne' rel='stylesheet' type='text/css' />

<script src="js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/js/index/index.js"></script>
    <link href = "/css/index.css" rel="stylesheet" type="text/css"/>

<script src="js/login/jquery.tabify.js" type="text/javascript" charset="utf-8"></script>

<script src="js/login/jquery.flexslider.js"></script>
<script type="text/javascript">
var $ = jQuery.noConflict();

$(window).load(function() {
	$('.images_slider').flexslider({
	animation: "slide",
	directionNav: false,
	controlNav: true,
	animationLoop: true,
	animationDuration: 300, 
	slideshow: false
	});
});

$(function() {
$('#tabsmenu').tabify();
$(".toggle_container").hide(); 
$(".trigger").click(function(){
	$(this).toggleClass("active").next().slideToggle("slow");
	return false;
});
});
</script>

<!--<script src="js/login/effects.js"></script>-->
<!--<script src="js/regit.js"></script>-->
<!--<script src="js/login/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>-->
<link rel="stylesheet" href="css/login/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />

<script type="text/javascript">
window.addEventListener("load",function() {
// Set a timeout...
setTimeout(function(){
// Hide the address bar!
window.scrollTo(0, 1);
}, 0);
});
</script>
</head>

<body id="page">
</section>    
    <div class="content">
        <blockquote style="height: 25px; margin-top: 20px;"><h1>会员登入</h1></blockquote>
        <div class="form">
<!--        <form action="/dologin" method="post" onsubmit="return doLogin();">-->
            <form>
        <label>会员帐号: </label><input type="text" name="userName" class="form_input" id="userName"/>
        <label>会员密码: </label><input type="password" name="userPassword" class="form_input" id="userPassword"/>
        <input type="button" value="登录" class="form_submit" style="margin-bottom: 10px;" onclick="doLogin()" />
        </form>
        <a href="/regit"><input type="button" value="加入会员" class="form_submit" /></a>
    </div>
    <div class="clear"></div>
    </div>
   
</div>
  <div class="margb20"></div>
<!-- 底部 -->
<div class="foot">
    <a href="/index" class="current" id="home">首页</a>
    <a href="#" id="sech">猜你喜欢</a>
    <a href="/ordercart" id="gwc">购物车</a>
    <a href="/aboutme" id="member">我的</a>
</div>
</section>
<!--<script type="text/javascript">-->
<!--    var _bdhmProtocol = (("https:" == document.location.protocol) ? " https//" : " http//");-->
<!--    document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fbc4525ac529334d19a9886f46cce7852' type='text/javascript'%3E%3C/script%3E"));-->
<!--</script>-->
<script >
    function doLogin() {
        // debugger
        var username = document.getElementById("userName").value;
        var password = document.getElementById("userPassword").value;
        var pwd=password;
        if (username==""||username==null){
            alert("请输入用户名！");
            return false;
        }else if (password==""||password==null){
            alert("请输入密码！");
            return false;
        }
        // alert("注册中");
        $.ajax({
            url: "/dologin",
            type : "POST",
            data :{
                "userName":username,
                "userPassword": password,
            },
            dataType: "json",
            async: false,
            success: function (data){
                // debugger;
                console.log("状态码为："+data.status)
                if (data.status==200){
                    // debugger;
                    alert("登录成功！");
                    window.location.href="/aboutme";
                }else {
                    alert("密码或者用户名错误！");
                    window.location.href="/login";
                }
            }
        })
    }
</script>
</body>
</html>